package net.hn.hnms.biz.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.hn.hnms.biz.project.domain.SupplierFile;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface SupplierFileMapper extends BaseMapper<SupplierFile> {

    @Update("<script>" +
            " update supplier_file set  del_flag = '1' " +
            " where supplier_id = #{supplierId}" +
            "</script>")
    void updateDeleteById(@Param("supplierId") String supplierId);

    @Select("<script>" +
            " SELECT  " +
            "  supplier_file_id supplierFileId,  " +
            "  supplier_id supplierId,  " +
            "  supplier_file_name supplierFileName,  " +
            "  supplier_file_path supplierFilePath,  " +
            "  create_time createTime," +
            "  oss_id ossId   " +
            " FROM  " +
            "  supplier_file   " +
            "WHERE  " +
            "  del_flag = '0' and supplier_id = #{supplierId}" +
            "</script>")
    List<SupplierFile> selectFileById(@Param("supplierId") String supplierId);
}
